﻿#region File and License Information
/*
<File>
	<License>
		Copyright © 2009 - 2017, Daniel Vaughan. All rights reserved.
		This file is part of Calcium (http://calciumsdk.net), 
		which is released under the MIT License.
		See file /Documentation/License.txt for details.
	</License>
	<CreationDate>$CreationDate$</CreationDate>
</File>
*/
#endregion

using System.Windows;

using Outcoder.Drawing;

namespace Outcoder
{
	public static class SizeExtensions
	{
		public static Size ScaleAndConstrainProportions(Size existingSize, Size maxProportions)
		{
			double newWidth;
			double newHeight;

			ScalingTool.ScaleAndConstrainProportions(
				existingSize.Width, existingSize.Height, 
				maxProportions.Width, maxProportions.Height, 
				out newWidth, out newHeight);

			return new Size(newWidth, newHeight);
		}
	}
}
